/*
 * @desc: 
 * @author: mao
 * @version: 1.0
 * @Date: 2023-08-03 11:14:35
 */
import request from '../service/axios'

// 媒资详情
export const mediaInfo = (id: string) => {
    return request({
        url: `/mediaresource-manage-service/medias/${id}`,
        method: 'get'
    });
};

// 音视频切条
export const cutAudioVideo = (data: any) => {
    return request({
        url: `/mediaresourcelib-media-transform/main/batch_shear`,
        method: 'post',
        data: data
    });
}

// 人脸识别
export const personFace = (data: any) => {
    return request({
        url: `/mediaresourcelib-aianalysis-service/contentanalysis/content`,
        method: 'get',
        params: data
    });
}

// 更新识别人的名字
export const editPersonFace = (data: any) => {
    return request({
        url: `/mediaresourcelib-aianalysis-service/contentanalysis/update/person`,
        method: 'put',
        data: data
    });
}

// 音频文本搜索
export const seachAudioText = (data: any) => {
    return request({
        url: `/mediaresourcelib-aianalysis-service/contentanalysis/content/audio_text`,
        method: 'get',
        params: data
    });
}

// 镜头分析
export const shotAnalysis = (data: any) => {
    return request({
        url: `/mediaresource-manage-service/medias/${data.id}/scenes`,
        method: 'get',
        params: data
    });
}

// 关键帧列表
export const keyFrameList = (data: any) => {
    return request({
        url: `/mediaresource-manage-service/medias/${data.id}/keyframes`,
        method: 'get'
    });
}

// 添加关键帧
export const addFrame = (data: any) => {
    return request({
        url: `/mediaresource-manage-service/medias/${data.id}/keyframes`,
        method: 'post',
        data: {
            url: data.url,
            time_line_point: data.time_line_point
        }
    });
}

// 删除关键帧
export const deleteFrame = (data: any) => {
    return request({
        url: `/mediaresource-manage-service/medias/${data.id}/keyframes`,
        method: 'delete',
        data: {
            url: data.url,
            time_line_point: data.time_line_point
        }
    });
}

// 获取子媒资列表
export const getChildMediaList = (data: any) => {
    return request({
        url: `/mediaresource-manage-service/medias/${data.id}/childs`,
        method: 'get'
    });
}

// 媒资信息编辑
export const mediaEdit = (data: any) => {
    return request({
        url: `/mediaresource-manage-service/medias/${data.id}`,
        method: 'put',
        data: data
    });
}

// 语音文字修改
export const audioEditText = (data: any) => {
    return request({
        url: `/mediaresourcelib-aianalysis-service/contentanalysis/update/audio_text`,
        method: 'put',
        data: data
    });
}

// 总量、今日、本周
export const getDayWeekCount = () => {
    return request({
        url: `/mediaresourcelib-finishedproduct-service/articlelib/view/other_statistic`,
        method: 'get'
    });
}

// 热词
export const getHotTag = () => {
    return request({
        url: `/mediaresourcelib-finishedproduct-service/articlelib/view/hot_world`,
        method: 'get'
    });
}

// 所有栏目
export const getAllColumn = () => {
    return request({
        url: `/mediaresourcelib-finishedproduct-service/articlelib/view/column_all`,
        method: 'get'
    });
}

// 所有来源
export const getAllSource = () => {
    return request({
        url: `/mediaresourcelib-finishedproduct-service/articlelib/view/source_all`,
        method: 'get'
    });
}

// 所有来源
export const getArticlelib = (data: any) => {
    return request({
        url: `/mediaresourcelib-finishedproduct-service/articlelib/view`,
        method: 'post',
        data: data
    });
}

// 来源指定栏目
export const getOneColumn = (name: string) => {
    return request({
        url: `/mediaresourcelib-finishedproduct-service/articlelib/view/column_part?orgName=${name}`,
        method: 'get'
    });
}

// 来源指定栏目
export const getotherStatistic = (data: any) => {
    return request({
        url: `/mediaresourcelib-finishedproduct-service/articlelib/view/source_statistic`,
        method: 'get',
        params: data
    });
}

// 拆条列表
export const shearList = (media_id: any) => {
    return request({
        url: `/mediaresourcelib-common-cms/subset/shear?media_id=${media_id}`,
        method: 'get'
    });        
}
